package zy.test.graphics;

import java.util.Date;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.View;

public class MyView2 extends View {

	Paint paint=new Paint();
	public MyView2(Context context) {
		super(context);
		paint.setColor(Color.RED);
		paint.setAntiAlias(true);
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		
		canvas.drawText(new Date().toLocaleString(), 200, 200, paint);
		//canvas.drawPicture(Picture.createFromStream(getResources().openRawResource(R.drawable.ic_launcher)));
		Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
		canvas.drawBitmap(bitmap, 200, 300, paint);
		for(int i=0;i<=9000;i++)
		{
		canvas.drawCircle(200, 400, (float)(Math.random()*100), paint);
		}
		System.out.println("on draw2");
	}
	
	

}
